#ifndef LINKED_STACK_H
#define LINKED_STACK_H

#include <stdbool.h>

#define MAX_TITLE_LENGTH        128
#define MAX_TIMESTAMP_LENGTH    30
#define MAX_URL_LENGTH          128

typedef struct {
    char title[MAX_TITLE_LENGTH];
    char timestamp[MAX_TIMESTAMP_LENGTH];
    char url[MAX_URL_LENGTH];
} BrowserData_t;

typedef struct StackNode_t{
    BrowserData_t data;
    struct StackNode_t *next;
} StackNode_t;

typedef struct {
    StackNode_t *top;
} LinkedStack_t;

typedef enum {
    LINKED_STACK_SUCCESS,
    LINKED_STACK_FAIL,
}LinkedSackStatus_t;

void LinkedStackInit(LinkedStack_t *stack);
bool LinkedStackIsEmpty(const LinkedStack_t *stack);
LinkedSackStatus_t LinkedStackPush(LinkedStack_t *stack, const BrowserData_t *data);
LinkedSackStatus_t LinkedStackPop(LinkedStack_t *stack, BrowserData_t *data);
LinkedSackStatus_t LinkedStackGetTop(const LinkedStack_t *stack, BrowserData_t *data);
void LinkedStackDestroy(LinkedStack_t *stack);

#endif
